<template>
  <div class="container">
    <g-tip>
      您当前未申领一码通请先进行一码通申领系统会自动为您开通主要民生领域相关服务。除此之外，还需要您确认开通医疗，卫生等领域的应用。
    </g-tip>
    <g-button @click="handleApplySSC">去申领</g-button>
  </div>
</template>

<script>
import GTip from "@/components/common/tip/Tip";
import GButton from "@/components/common/button/Button";
import nus from "@nsrd/nus";

export default {
  name: "Home",
  components: { GTip, GButton },
  data() {
    return {};
  },
  created() {
    document.title = "申领电子社保卡";
  },
  methods: {
    handleApplySSC() {
      nus.jsbridge
        .callAPP("CODE_PLATFORM_CALL_SERVICE_PROVIDER", {
          method: "applySSC" // 调用{申领电子社保卡}
        })
        .then(res => {
          console.log("[applySSC]", res);
        })
        .catch(err => {
          console.error("[applySSC]", err);
          this.consoleOutput = err;
        });
      setTimeout(() => {
        this.$router.replace("/");
      }, 1000);
    }
  }
};
</script>

<style lang="less" scoped>
.container {
}
</style>
